home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-teiopi.ads < prev    next >
Text File  |  1994-05-19  |  4KB  |  95 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                 A D A . T E X T _ I O . P I C T U R E S                  --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. package Ada.Text_IO.Pictures is
  26.  
  27.    pragma Unimplemented_Unit;
  28.  
  29.    type Picture is private;
  30.  
  31.    function Valid (Item : in String) return Boolean;
  32.  
  33.    function To_Picture (Item : in String) return Picture;
  34.  
  35.    function To_String (Item : in Picture) return String;
  36.  
  37.    Max_Picture_Length : constant := 30;
  38.  
  39.    Picture_Error : exception;
  40.  
  41.    --  Localization features:
  42.  
  43.    Max_Currency_Length : constant := 10;
  44.  
  45.    subtype Currency_Length_Range is
  46.      Integer range 1 .. Max_Currency_Length;
  47.  
  48.    type Locale (Length : Currency_Length_Range := 1) is record
  49.       Currency    : String (1 .. Length) := "$";
  50.       Fill        : Character            := '*';
  51.       Separator   : Character            := ',';
  52.       Radix_Mark  : Character            := '.';
  53.    end record;
  54.  
  55.    generic
  56.       type Num is delta <> digits <>;
  57.  
  58.    package Edited_Output is
  59.  
  60.       Default_Locale  : Locale;
  61.  
  62.       function Length (Pic     : in Picture;
  63.                        Symbols : in Locale := Default_Locale)
  64.         return Natural;
  65.  
  66.       function Image (Item    : in Num;
  67.                       Pic     : in Picture;
  68.                       Symbols : in Locale  := Default_Locale)
  69.         return String;
  70.  
  71.       procedure Put (File    : in File_Type;
  72.                      Item    : in Num;
  73.                      Pic     : in Picture;
  74.                      Symbols : in Locale  := Default_Locale);
  75.  
  76.       procedure Put (Item    : in Num;
  77.                      Pic     : in Picture;
  78.                      Symbols : in Locale  := Default_Locale);
  79.  
  80.       procedure Put (To      : out String;
  81.                      Item    : in Num;
  82.                      Pic     : in Picture;
  83.                      Symbols : in Locale  := Default_Locale);
  84.  
  85.    end Edited_Output;
  86.  
  87. private
  88.  
  89.    type Picture is record
  90.       Length : Natural;
  91.       Data   : String (1 .. 30);
  92.    end record;
  93.  
  94. end Ada.Text_IO.Pictures;
  95.